package cn.cloudtogo.support.mysql.table;

import cn.cloudtogo.common.types.Pair;
import cn.cloudtogo.support.mysql.Condition;

import java.util.List;

/**
 * @author yaolianhua789@gmail.com
 **/
public interface TableRowApi {

    /******* insert *******/
    int insert(String uuid, String table, Pair pair);

    List<Pair> insertBatch(String uuid, String table, Pair... pairs);

    /******* delete *******/
    int delete(String uuid, String table, String id);

    int deleteBatch(String uuid, String table, String primaryKey, String idComma);

    /******* update *******/
    Pair update(String uuid, String table, String id, Pair pair);

    /******* query *******/
    Pair find(String uuid, String table, String id);

    List<Pair> find(String uuid, String table, Condition condition);

    /******* count *******/
    int count(String uuid, String table, String where);

}
